/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkStateGridBDataType.h"

CMkStateGridBRequestBase::CMkStateGridBRequestBase(const MkString& RouterId, const MkString& DstId, const MkStateGridBMessageType& MsgType)
    : m_MsgType(MsgType)
    , m_RouterId(RouterId)
    , m_DstId(DstId)
{

}

CMkStateGridBRegisterRequest::CMkStateGridBRegisterRequest(const MkString &RouterId, const MkString& DstId, const MkString &DevHost, Uint16 DevPort, const MkString &AuthorType, const MkString &UserName, const MkString &Realm, const MkString &Nonce, const MkString &Uri, const MkString &Response, const MkString &Algorithm, Uint32 Expires)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBRegister)
    , m_DevHost(DevHost)
    , m_DevPort(DevPort)
    , m_AuthorType(AuthorType)
    , m_UserName(UserName)
    , m_Realm(Realm)
    , m_Nonce(Nonce)
    , m_Uri(Uri)
    , m_Response(Response)
    , m_Algorithm(Algorithm)
    , m_Expires(Expires)
{

}

CMkStateGridBResoursePushRequest::CMkStateGridBResoursePushRequest(const MkString& RouterId, const MkString& DstId, const MkString& ParentId, const MkMapStateGridBResourse& MapResourse)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBResoursePush)
    , m_MapResourse(MapResourse)
    , m_ParentId(ParentId)
{

}

CMkStateGridBGetResourseRequest::CMkStateGridBGetResourseRequest(const MkString& RouterId, const MkString& DstId, Uint32 FromIndex, Uint32 ToIndex)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBGetResourse)
    , m_FromIndex(FromIndex)
    , m_ToIndex(ToIndex)
{

}

CMkStateGridBFindRecordRequest::CMkStateGridBFindRecordRequest(const MkString& RouterId, const MkString& DstId, Uint32 RecordType, const MkString& UserCode, const CMkTime& BeginTime, const CMkTime& EndTime, Uint32 FromIndex, Uint32 ToIndex)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBGetRecord)
    , m_RecordType(RecordType)
    , m_UserCode(UserCode)
    , m_BeginTime(BeginTime)
    , m_EndTime(EndTime)
    , m_FromIndex(FromIndex)
    , m_ToIndex(ToIndex)
{

}

CMkStateGridBGetAlarmRequest::CMkStateGridBGetAlarmRequest(const MkString& RouterId, const MkString& DstId, Uint32 AlarmType, const MkString& UserCode, const CMkTime& BeginTime, const CMkTime& EndTime, Uint32 AlarmLevel, Uint32 FromIndex, Uint32 ToIndex)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBGetAlarm)
    , m_AlarmType(AlarmType)
    , m_AlarmLevel(AlarmLevel)
    , m_UserCode(UserCode)
    , m_BeginTime(BeginTime)
    , m_EndTime(EndTime)
    , m_FromIndex(FromIndex)
    , m_ToIndex(ToIndex)
{

}

CMkStateGridBMediaRequest::CMkStateGridBMediaRequest(const MkString& RouterId, const MkString& DstId, const MkString& SessionId, const MkString& RtpHost, Uint16 RtpAudioPort, Uint16 RtpVideoPort)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBMedia)
    , m_SessionId(SessionId)
    , m_RtpHost(RtpHost)
    , m_RtpAuidoPort(RtpAudioPort)
    , m_RtpVideoPort(RtpVideoPort)
{

}

CMkStateGridBMediaShutDownRequest::CMkStateGridBMediaShutDownRequest(const MkString& RouterId, const MkString& DstId, const MkString& SessionId)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBMediaShutDown)
    , m_SessionId(SessionId)
{

}

CMkStateGridBPtzControlRequest::CMkStateGridBPtzControlRequest(const MkString& RouterId, const MkString& DstId, Uint32 Cmd, Uint32 Param1, Uint32 Param2, Uint32 Param3)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBPtzControl)
    , m_Cmd(Cmd)
    , m_Param1(Param1)
    , m_Param2(Param2)
    , m_Param3(Param3)
{

}

CMkStateGridBSubscribeRequest::CMkStateGridBSubscribeRequest(const MkString& RouterId, const MkString& DstId, const MkString& SubscribeId, const MkStateGridBSubscribeType& SubScribeType, Uint32 Expires, const MkMap<MkString, Uint32>& MapSubId)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBSubscribe)
    , m_SubscribeId(SubscribeId)
    , m_Expires(Expires)
    , m_MapSubCode(MapSubId)
    , m_SubscribeType(SubScribeType)
{

}

CMkStateGridBSubscribeNotifyRequest::CMkStateGridBSubscribeNotifyRequest(const MkString& RouterId, const MkString& DstId, const MkString& SubscribeId, const MkString& StrState, const MkStateGridBSubscribeType SubscribeType, const MkString& Code, const MkString& Name, const Uint32 AlarmType, const CMkTime& StartTime, const CMkTime& EndTime, Uint32 Status)
    : CMkStateGridBRequestBase(RouterId, DstId, MkStateGridBSubscribeNotify)
    , m_StrState(StrState)
    , m_Code(Code)
    , m_Name(Name)
    , m_AlarmType(AlarmType)
    , m_StartTime(StartTime)
    , m_EndTime(EndTime)
    , m_SubscribeType(SubscribeType)
    , m_SubscribeId(SubscribeId)
    , m_Status(Status)
{

}

CMkStateGridBResponseBase::CMkStateGridBResponseBase(const MkString& RouterId, const MkString& DstId, const MkStateGridBMessageType& MsgType)
    : m_MsgType(MsgType)
    , m_RouterId(RouterId)
    , m_DstId(DstId)
{

}

CMkStateGridBGetResourceResponse::CMkStateGridBGetResourceResponse(const MkString& RouterId, const MkString& DstId, const MkString& ParentId, Uint32 RealNum, Uint32 SubNum, Uint32 FromIndex, Uint32 ToIndex, const MkMapStateGridBResourse& MapResourse)
    : CMkStateGridBResponseBase(RouterId, DstId, MkStateGridBGetResourse)
    , m_ParentId(ParentId)
    , m_RealNum(RealNum)
    , m_SubNum(SubNum)
    , m_FromIndex(FromIndex)
    , m_ToIndex(ToIndex)
    , m_MapResourse(MapResourse)
{

}

CMkStateGridBGetAlarmResponse::CMkStateGridBGetAlarmResponse(const MkString& RouteId, const MkString& DstId, Uint32 RealNum, Uint32 SubNum, Uint32 FromIndex, Uint32 ToIndex, const MkVectorStateGridBAlarm& VecAlarm)
    : CMkStateGridBResponseBase(RouteId, DstId, MkStateGridBGetAlarm)
    , m_RealNum(RealNum)
    , m_SubNum(SubNum)
    , m_FromIndex(FromIndex)
    , m_ToIndex(ToIndex)
    , m_VecAlarm(VecAlarm)
{

}

CMkStateGridBGetRecordResponse::CMkStateGridBGetRecordResponse(const MkString& RouteId, const MkString& DstId, Uint32 RealNum, Uint32 SubNum, Uint32 FromIndex, Uint32 ToIndex, const MkVectorStateGridBRecord& VecRecord)
    : CMkStateGridBResponseBase(RouteId, DstId, MkStateGridBGetRecord)
    , m_RealNum(RealNum)
    , m_SubNum(SubNum)
    , m_FromIndex(FromIndex)
    , m_ToIndex(ToIndex)
    , m_VecRecord(VecRecord)
{

}

CMkStateGridBMediaResponse::CMkStateGridBMediaResponse(const MkString& RouterId, const MkString& DstId, const MkString& SessionId, const MkString& AnswerSdp, const EventResponseCallback& EventCb)
    : CMkStateGridBResponseBase(RouterId, DstId, MkStateGridBMedia)
    , m_SessionId(SessionId)
    , m_AnswerSdp(AnswerSdp)
    , m_EventCb(EventCb)
{

}

CMkStateGridBSubscribeResponse::CMkStateGridBSubscribeResponse(const MkString& RouterId, const MkString& DstId, const MkString& SubscribeId, Uint32 Expires)
    : CMkStateGridBResponseBase(RouterId, DstId, MkStateGridBSubscribe)
    , m_SubscribeId(SubscribeId)
    , m_Expires(Expires)
{

}

CMkStateGridBRegisterResponse::CMkStateGridBRegisterResponse(const MkString& RouterId, const MkString& DstId, const MkString& RegisterId, const MkSipStatus& SipStatus, const MkString& UpRealm, const MkString& UpNonce, const MkString Algorithm)
    :CMkStateGridBResponseBase(RouterId, DstId, MkStateGridBRegister)
    , m_Status(SipStatus)
    , m_UpRealm(UpRealm)
    , m_UpNonce(UpNonce)
    , m_UpAlgorithm(Algorithm)
    , m_RegisterId(RegisterId)
{

}